package com.vinci.webtrading.dao.entity;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;


@Entity
@Table(name="COMPTE")

public class Compte {

	private Integer id;
	private String libelleCompte;
	private Double solde;
	private Client client;
	
	public Compte() {
		super();
		// TODO Auto-generated constructor stub
	}
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="COMPTE_ID")
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column(name="LIBELLECOMPTE")
	public String getLibelleCompte() {
		return libelleCompte;
	}
	public void setLibelleCompte(String libelleCompte) {
		this.libelleCompte = libelleCompte;
	}
	
	@Column(name="SOLDE")
	public Double getSolde() {
		return solde;
	}
	public void setSolde(Double solde) {
		this.solde = solde;
	}
	
	@OneToOne(optional=false, mappedBy="compte")
	public Client getClient() {
		return client;
	}
	public void setClient(Client client) {
		this.client = client;
	}
	@Override
	public String toString() {
		return "Compte [id=" + id + ", libelleCompte="
				+ libelleCompte + ", solde=" + solde + "]";
	}
	
	
	
}
